<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>
<? include_once("../controller/detail-info.php");
// 输出Excel文件头，可把user.csv换成你要的文件名
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="财务信息.xls"');
header('Cache-Control: max-age=0');
?>





        <Style>
            table{border: solid 1px #cccccc}
            table th{border: solid 1px #cccccc}
            table tr{border: solid 1px #cccccc}
            table td{border: solid 1px #cccccc}

            table {
                border-collapse: collapse; /* 折叠边框 */
            }
            table, th, td {
                border: 1px solid black; /* 实线边框 */
            }
        </Style>



            <h1><?echo $detail['name']?> 项目信息</h1>


                        <table class="layui-table">
                            <colgroup>

                                <col >
                                <col width="120" >
                                <col width="120" >
                                <!--	<col >-->
                                <col width="150" >
                                <col width="100" >


                            </colgroup>
                            <thead>
                            <tr>
                                <th>项目名称</th>
                                <th>开始日期</th>
                                <th>结束日期</th>
                                <!--      <th>项目金额</th>-->
                                <th>发布人</th>
                                <th>状态</th>
                            </tr>
                            </thead>
                            <tbody>







                            <tr>
                                <td><?echo $case['name']?></td>
                                <td><?echo substr($case['startdate'],0,10)?></td>
                                <td><?echo substr($case['enddate'],0,10)?> </td>
                                <!--	  <td>--><?//echo $case['sum']?><!--</td>-->





                                <? $agent = select_one_line_all_items($table_Prefix."member","nid ='".$case['agent']."'"); ?>
                                <td>
                                    <a  target="_blank" href="../member/detail-statistic.php?&nid=<?echo $case['agent']?>">
                                        <?echo $agent['name']?>
                                    </a>
                                </td>



                                <td><?echo $case['status']?></td>


                            </tr>



                            </tbody>
                        </table>





                        <ul class="layui-tab-title">
                            <li class="layui-this">报价信息<?php if($task_list){ ?><span class="layui-badge"><?php echo count($task_list); ?></span><?php } ?></li>
                        </ul>



                                    <? $case_detail=select_lines_all_items($table_Prefix."case_detail","nid desc","case_nid ='".$_REQUEST['nid']."'","") ;?>
                                    <? $case_quotation=select_lines_all_items($table_Prefix."quotation_detail","case_nid asc,price asc","case_nid ='".$_REQUEST['nid']."'","") ;?>




                                    <table  >

                                        <colgroup>

                                            <col width="80" >
                                            <col   >
                                            <col width="100" >

                                            <col   >
                                            <col   >
                                            <col   >
                                            <col   >
                                            <col   >


                                        </colgroup>

                                        <?if(count($case_detail)>0){?>
                                            <tr style="border: solid 1px #cccccc" >
                                                <th >编号</th>
                                                <th>采购项</th>
                                                <th>采购数量</th>
                                                <th>企业</th>
                                                <th>金额</th>
                                                <th>申请日期</th>
                                                <th>备注</th>
                                                <th>状态</th>
                                            </tr>
                                        <?}else{echo "暂无数据";}?>


                                        <?for($iiix=0;$iiix<count($case_detail);$iiix++){?>




                                            <tr id="item<?echo $case_detail[$iiix]['nid']?>" style="font-weight: bold">
                                                <td> <?echo $iiix+1 ?></td>
                                                <td> <?echo $case_detail[$iiix]['product_name']?></td>
                                                <td> <?echo $case_detail[$iiix]['number']?></td>
                                                <td> </td>
                                                <td> </td>
                                                <td> </td>
                                                <td> </td>
                                                <td> </td>



                                            </tr>

                                            <?
                                            $_i=0;
                                            foreach ($case_quotation as $k=>$v){

                                                if($case_detail[$iiix]['product_nid']==$v['product_nid']){
                                                    $_i++;
                                                    ?>
                                                    <tr>
                                                        <td> </td>
                                                        <td> </td>
                                                        <td> </td>
                                                        <td><?echo $v['unit_name']?></td>
                                                        <td><?echo $v['price']?></td>
                                                        <td><?echo $v['date']?></td>
                                                        <td><?echo $v['remark']?></td>
                                                        <td><?echo $v['status']?></td>

                                                    </tr>

                                                    <?;}?>
                                                <?;}?>


                                            <?if($_i<1){?>
                                                <tr style="text-align: center">
                                                    <td colspan="9"> 暂无报价 </td>
                                                </tr>

                                                <?;}?>






                                            <?;}?>


                                    </table>


